/// @tags:
#include <cstdio>
#include <iostream>
#include <vector>

using std::cin;
using std::cout;

extern "C" {

int query(int, int);
}

constexpr int MAXN = 2e5 + 3;

inline int lowbit(int x) { return x & -x; }

int n, cnt;
int t1[MAXN], t2[MAXN], sum[MAXN];
bool tag[MAXN];
std::vector<int> ans;

void update1(int x) {
  x++;
  while (x) t1[x]++, x -= lowbit(x);
}

int ask(int x) {
  x++;
  int v = 0;
  while (x <= 2 * n) v += t1[x], x += lowbit(x);
  return v;
}

void update2(int x, int v) {
  x++;
  while (x <= 2 * n) t2[x] += v, x += lowbit(x);
}

int get(int k) {
  int x = 0, v = 0;
  for (int i = 17; i >= 0; --i)
    if ((x | (1 << i)) <= 2 * n && t2[x | (1 << i)] < k) k -= t2[x |= 1 << i];
  return x;
}

int q(int l, int r) {
  if (l >= r) return 0;
  if (l == 0 && r == 2 * n - 1) return n;
  return query(l, r);
}

void solve(int l, int r, int s) {
  if (l == r) {
    tag[l] = s;
    return;
  }
  if (!s) return;
  if (l + s - 1 == r) {
    for (int i = l; i <= r; ++i) tag[i] = true;
    return;
  }
  int mid = (l + r) >> 1, v = (sum[mid + 1] = q(0, mid)) - sum[l];
  solve(l, mid, v), solve(mid + 1, r, s - v);
}

void work() {
  ans.resize(2 * n), update2(0, 1), cnt++, solve(0, 2 * n - 1, n);
  for (int i = 1; i < 2 * n; ++i) {
    if (!tag[i]) {
      update2(i, 1), cnt++;
      continue;
    }
    int l = 1, r = cnt, x = 1;
    while (l <= r) {
      int mid = (l + r + (rand() & 1)) >> 1, t = get(mid);
      if (q(t, i) == ask(t) + 1)
        x = t, l = mid + 1;
      else
        r = mid - 1;
    }
    update1(ans[i] = x), update2(ans[i], -1), cnt--, ans[ans[i]] = i;
  }
}

std::vector<int> match(int num) {
  n = num, work();
  return ans;
}
